package designMode.compositePattern;


import java.util.Iterator;

/**
 * @author LIBOFEI
 * @ClassName NullIterator
 * @description  返回空迭代器，避免返回null
 * @date 2020/6/28 14:45
 * @Version 1.0
 **/
public class NullIterator implements Iterator {
    @Override
    public boolean hasNext() {
        return false;
    }

    @Override
    public Object next() {
        return null;
    }

    @Override
    public void remove() {
        throw new UnsupportedOperationException();
    }
}
